package org.study.zihan.demo;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 服务端与客户端成功地进行通信，每个任务以异步的方式一起执行，大大增加程序运行时的吞吐量，提高了数据处理的能力。
 * Created by dwlijx on 2021/4/26.
 * connect to lijx@zjhcsoft.com
 */
public class BeginServer {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8888);
        int runTag = 1 ;
        while (runTag == 1){
            Socket socket = serverSocket.accept();
            BeginThread beginThread = new BeginThread(socket);
            beginThread.start();
        }
        serverSocket.close();
    }
}
